package com.checkoutcheckins.client.data;

import com.checkoutcheckins.client.Home;
import com.checkoutcheckins.client.data.foursquare.FoursquareCheckins;
import com.checkoutcheckins.client.data.foursquare.FoursquareUser;
import com.checkoutcheckins.client.data.foursquare.Settings;
import com.checkoutcheckins.client.panels.StatusPanel;
import com.checkoutcheckins.client.widgets.CheckoutCheckinsMapContainer;
import com.google.gwt.maps.client.MapWidget;

public class CheckoutcheckinsHomeContainer implements DataContainer{
	
	private Home home = null;

	private FoursquareUser foursquareUser = null;
	
	private CheckoutCheckinsMapContainer mapContainer = null;
	
	private String token = null;
	
	private String secret = null;

	private FoursquareCheckins foursquareCheckins = new FoursquareCheckins();
	
	private FoursquareCheckins foursquareFriendCheckins = new FoursquareCheckins();

	private StatusPanel statusPanel;

	private Settings settings;
	
	public CheckoutcheckinsHomeContainer(Home home) {
		this.home = home;
	}

	public FoursquareUser getFoursquareUser() {
		return foursquareUser;
	}

	public void setFoursquareUser(FoursquareUser foursquareUser) {
		this.foursquareUser = foursquareUser;
	}
	
	public void setAndUpdateFoursquareUser(FoursquareUser foursquareUser) {
		this.foursquareUser = foursquareUser;
		home.updateFoursquareUser();
	}

	public MapWidget getMap() {
		return mapContainer.getMap();
	}

	public void setMapContainer(CheckoutCheckinsMapContainer mapContainer) {
		this.mapContainer = mapContainer;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public String getSecret() {
		return secret;
	}

	public void setSecret(String secret) {
		this.secret = secret;
	}

	public void updateFoursquareCheckins() {
		home.updateFoursquareCheckins();
	}

	@Override
	public FoursquareCheckins getFoursquareCheckins() {
		return foursquareCheckins;
	}

	@Override
	public void setFoursquareCheckins(FoursquareCheckins foursquareCheckins) {
		this.foursquareCheckins = foursquareCheckins;
	}

	public CheckoutCheckinsMapContainer getMapContainer() {
		return mapContainer;
	}

	public void setStatusPanel(StatusPanel statusPanel) {
		this.statusPanel = statusPanel;		
	}

	public StatusPanel getStatusPanel() {
		return statusPanel;
	}

	@Override
	public FoursquareCheckins getFoursquareFriendCheckins() {
		return foursquareFriendCheckins;
	}

	@Override
	public void setFoursquareFriendCheckins(FoursquareCheckins foursquareFriendCheckins) {
		this.foursquareFriendCheckins = foursquareFriendCheckins;
	}

	@Override
	public void updateFoursquareFriendCheckins() {
		home.updateFoursquareFriendCheckins();
	}

	@Override
	public Settings getUserSettings() {
		return settings;
	}

	@Override
	public void setUserSettings(Settings settings) {
		this.settings = settings;
	}

}
